// historytable.js



	/* function  toggleContent use to expand/collapse the underlying rocord.*/
	function toggleContent(obj)
	{
		//get row of the selected row.
		var oRow = obj;

          //alert(oRow.nextSibling.className);
          if(oRow.nextSibling.className=='trHidden'){
            //oRow.getElementsByTagName("img")(0).src = 'images/expand.gif';
            oRow.className ='trSelect';
            oRow.nextSibling.className = 'trShow';
          }else{
            //oRow.getElementsByTagName("img")(0).src = 'images/collapse.gif';
            oRow.className ='trUnselect';
            oRow.nextSibling.className = 'trHidden';
          }

	}
	
	/* function  rowOver, trigger when mouse move over the row */
    function  rowOver(obj){
      var oRow = obj;
        // over state
        oRow.style.cursor = 'hand';
        oRow.style.backgroundColor =  '#FFCC00';
        //window.status = obj.id;
    }
	
  	/* function  rowOut, trigger when mouse move out from the row */
    function  rowOut(obj){
      var oRow = obj;
        // out state
        oRow.style.cursor = '';
        oRow.style.backgroundColor =  '';
    }
    
	function editItem(keyColumn){
    form1.submit();
	}
	
  /* function expandAll, expand all collapse enabled row inside the 'tabId' */  
  function expandAll(tabId){
    var tabObj = document.getElementById(tabId);
    var rowObjs = tabObj.getElementsByTagName('TR');
    
      for(var i=0;i<rowObjs.length;i++){
      //alert(rowObjs(i).style.display);
        if(rowObjs(i).className=='trHidden'){
            rowObjs(i).previousSibling.className='trSelect';
            rowObjs(i).className = 'trShow'
        }
      }
  }
  
  /* function collapseAll, callpase all expanded enabled row inside the 'tabId' */
  function collapseAll(tabId){
    var tabObj = document.getElementById(tabId);
    var rowObjs = tabObj.getElementsByTagName('TR');
    
      for(var i=0;i<rowObjs.length;i++){
      //alert(rowObjs(i).style.display);
        if(rowObjs(i).className=='trShow'){
            rowObjs(i).previousSibling.className='trUnSelect';
            rowObjs(i).className = 'trHidden'
        }
      }
  }
  /* open the modal dialog for edit page*/
  function modifyContent(keyInformation){
      var urlString = "history_table_ex01_edit.jsp?param1="+keyInformation;
      var dialogW = window.showModalDialog(urlString,"dialogWidth:<%= dialogWidth %>px; dialogHeight:<%= dialogHeight%>px");
  }
  /* function downloadThis */
  function downloadThis(keyInformation){
    var downloadUrl = 'softplus.carrefour.hd.bltier.util.downloadServlet';
    document.hidFrame.location = downloadUrl+'?param1='+keyInformation;
  }
  
